<template>
  <view class="startPageContainer">
    <view class="header">
      <view class="logoImg">
        <image src="/static/images/logo.png" mode="widthFix"></image>
      </view>
      <view class="titleText">培训管理系统</view>
    </view>
    <view class="body">
      <view class="itemBox" @click="goTo('/pages/teacher/index')">
        <view>
          <image src="/static/images/teacherImg.png" mode="widthFix"></image>
          <text>我是老师</text>
        </view>
        <view>
          <view>
            <text>立即注册</text>
            <u-icon name="arrow-right" color="#2979ff" size="28"></u-icon>
          </view>
        </view>
      </view>
      <view class="itemBox" @click="goTo('/pages/index/index', 'tab')">
        <view>
          <image src="/static/images/studentImg.png" mode="widthFix"></image>
          <text>我是学生</text>
        </view>
        <view>
          <view>
            <text>立即注册</text>
            <u-icon name="arrow-right" color="#2979ff" size="28"></u-icon>
          </view>
        </view>
      </view>
    </view>
<!--    <view class="footer">-->
<!--      <view>-->
<!--        已有账号？-->
<!--        <text class="textColor">立即登录</text>-->
<!--      </view>-->
<!--    </view>-->
  </view>
</template>

<script>
export default {
  data() {
    return {
    }
  },
  onLoad() {
  },
  methods: {
    goTo(url, type) {
      if(type === 'tab') {
        uni.switchTab({
          url
        })
      } else {
        uni.navigateTo({
          url
        })
      }
    }
  },
}
</script>

<style lang="scss">
page{
  background-image: linear-gradient(to bottom, #4683d4, #fff);
}
.startPageContainer{
  padding-top: 100rpx;
  .header{
    .logoImg{
      width: 150rpx;
      height: 150rpx;
      border-radius: 50%;
      border: 4rpx solid #fff;
      margin: 0 auto;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      image{
        width: 80%;
        height: 80%;
        display: block;
      }
    }
    .titleText{
      font-size: 36rpx;
      color: #fff;
      text-align: center;
      line-height: 100rpx;
      font-weight: bold;
      margin: 20rpx 0;
    }
  }
  .body{
    padding: 100rpx;
   .itemBox{
     background: #fff;
     padding: 40rpx;
     border-radius: 16rpx;
     margin-bottom: 60rpx;
     >view{
       display: flex;
       align-items: center;
       &:nth-of-type(1) {
         image{
           width: 120rpx;
           height: 120rpx;
           margin-right: 20rpx;
         }
         text{
           font-size: 36rpx;
           color: #4683d4;
           font-weight: bold;
         }
       }
       &:nth-of-type(2) {
          justify-content: flex-end;
          text{
            color: #4683d4;
          }
       }
     }
   }
  }
  .footer{
    position: fixed;
    bottom: 100rpx;
    left: 0;
    width: 100%;
    height: 100rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    view{
      .textColor {
        color: #4683d4;
      }
    }
  }
}
</style>
